Skip to content

[SDK] Feature: Adds defaultCountryCode prop to ConnectButton #5709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Dec 12, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces a defaultSmsCountryCode configuration option for In-App and Ecosystem Wallets, enhancing SMS authentication by allowing a default country code to be set.

Detailed summary

  • Added defaultSmsCountryCode option to createWallet for In-App and Ecosystem Wallets.
  • Updated EcosystemWalletCreationOptions and InAppWalletCreationOptions to include defaultSmsCountryCode.
  • Modified InputSelectionUI to initialize countryCodeInfo with defaultSmsCountryCode.
  • Enhanced tests for InputSelectionUI and CountrySelector to verify default country code behavior.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

linear bot commented Dec 12, 2024

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 8:51pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 8:51pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 8:51pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 8:51pm

Copy link

changeset-bot bot commented Dec 12, 2024

🦋 Changeset detected

Latest commit: d955c72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

graphite-app bot commented Dec 12, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

github-actions bot commented Dec 12, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.94 KB (0%) 899 ms (0%) 3.2 s (-18.44% 🔽) 4.1 s
thirdweb (cjs) 110.78 KB (0%) 2.3 s (0%) 5.6 s (-7.57% 🔽) 7.8 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 283 ms (+42.33% 🔺) 394 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 46 ms (-15.34% 🔽) 56 ms
thirdweb/react (minimal + tree-shaking) 19.03 KB (0%) 381 ms (0%) 823 ms (+34.57% 🔺) 1.3 s

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.

Project coverage is 52.88%. Comparing base (ce0da51) to head (d955c72).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...b/src/react/web/wallets/in-app/CountrySelector.tsx 63.63% 4 Missing ⚠️
.../web/wallets/shared/ConnectWalletSocialOptions.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5709      +/-   ##
==========================================
+ Coverage   51.53%   52.88%   +1.34%     
==========================================
  Files        1094     1098       +4     
  Lines       57592    58976    +1384     
  Branches     4755     4791      +36     
==========================================
+ Hits        29681    31189    +1508     
+ Misses      27193    27070     -123     
+ Partials      718      717       -1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from e2ec5db
packages 49.98% <68.42%> (+1.74%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
.../src/react/web/wallets/in-app/InputSelectionUI.tsx 59.59% <100.00%> (+57.49%) ⬆️
...eact/web/wallets/in-app/supported-sms-countries.ts 100.00% <100.00%> (ø)
.../web/wallets/shared/ConnectWalletSocialOptions.tsx 31.37% <0.00%> (-0.16%) ⬇️
...b/src/react/web/wallets/in-app/CountrySelector.tsx 89.13% <63.63%> (+84.78%) ⬆️

... and 11 files with indirect coverage changes

],
mode: "redirect",
passkeyDomain: getDomain(),
defaultSmsCountryCode: "AF",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would just show this option, maybe with auth option "phone"

kinda confusing to see passkey/mode in here too

Comment on lines 10 to 22
options: [
"google",
"discord",
"telegram",
"email",
"passkey",
"phone",
"farcaster",
"line",
],
mode: "redirect",
passkeyDomain: getDomain(),
defaultSmsCountryCode: "AF",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
options: [
"google",
"discord",
"telegram",
"email",
"passkey",
"phone",
"farcaster",
"line",
],
mode: "redirect",
passkeyDomain: getDomain(),
defaultSmsCountryCode: "AF",
options: [
"phone",
],
defaultSmsCountryCode: "IN", // default to india country code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants